home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 July / EnigmA AMIGA RUN 20 (1997)(G.R. Edizioni)(IT)[!][issue 1997-07 & 08][EAR-CD IV].iso / lightwave / utilities / par251 / rexx / copyselect.ddr < prev    next >
Text File  |  1994-12-02  |  1KB  |  57 lines

  1. /* 
  2.    Program to copy specific contents (found in the file 'ram:temp'
  3.    of one PAR drive to another 
  4.    Requires PAR 2.06 or higher 
  5.    To create the file 'temp' in ram, issue the following command at 
  6.    the command line:
  7.    List >ram:temp (drive) LFORMAT %p%s FILES ALL
  8.    where (drive) is the path such as DD0: to get all the file information 
  9.    for.
  10.  
  11.    Edit the file ram:temp by removing the lines containing files you do 
  12.    not want copied from one par drive to another, and save the file.
  13.  
  14.    Then run the PAR program and hit the f5 key to invoke this arexx script.
  15.  
  16. */
  17.  
  18. address DDR 
  19.  
  20. /*address command List >ram:temp dd1: LFORMAT %s
  21. */
  22. file_list1 = 'ram:temp'
  23.  
  24. if open('myfile',file_list1,'READ') then do
  25.  
  26.    do while ~EOF('myfile')
  27.  
  28.       ff_name = readln('myfile')
  29.       address command 'makedir dd1:'||ff_name
  30.  
  31.    end
  32.  
  33.    call close('myfile')
  34. end
  35.  
  36. file_list  = 'ram:temp'
  37.  
  38. if open('myfile',file_list,'READ') then do 
  39.  
  40.    do while ~EOF('myfile')
  41.  
  42.       ff_name = readln('myfile')
  43.       ff_name_len = length(ff_name)
  44.       f_dest_path = 'dd1:'||right(ff_name,ff_name_len-4)
  45.       dest_path_len  = index(f_dest_path,'/') - 1
  46.       dest_path = left(f_dest_path,dest_path_len)
  47.       copy ff_name dest_path 
  48.  
  49.    end
  50.  
  51.    call close('myfile')
  52.    end
  53.  
  54. else
  55.    say 'cant open file'
  56. EXIT
  57.